#ifndef __INCcliArgParseh
#define __INCcliArgParseh

#include <cstdio>
#include <map>
#include <vector>
#include <string>
#include <cliArg.h>
#include <sstream>
#include <declarecClass.h>

namespace cli {
    class Interface
    {
    private:
        DISABLE_COPY_CLASS(Interface);
        std::string program_name_;
        std::string description_;
        std::string lastErrorMsg;
        std::vector<const ParamConfig*> params_;
        std::map<std::string, const ParamConfig*> long_name_map_;
        std::map<std::string, const ParamConfig*> short_name_map_;

    private:
        bool name_exists(const char* long_name, const char* short_name) const;
        STATUS add_param(const ParamConfig* param);
        STATUS addDefaultCommands();

    public:
        Interface(const char* program_name, const char* description);
        STATUS add_params(const std::vector<ParamConfig>& params);
        STATUS parse(const std::vector<std::string>& argv, Args& args);
        STATUS print_help(std::ostringstream& oss) const;
        const std::string& getLastError() const;
    };
}

#endif // CLI_INTERFACE_H
